<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="com.kylin.module.study.orm.*,
				 com.kylin.common.*,
				 com.kylin.common.util.*,
				 com.kylin.common.dict.orm.Dict,
				 com.kylin.common.paginate.DisplayPage"%>
<%@ include file="/common/include/pageExpires.jsp"%>
<%@ include file="/common/include/taglibs.jsp"%>
<%@ include file="/common/include/dictNames.jsp"%>

<%
	String catname = "";
	List cat_study1s = MemObjFactory.getDict(dict_cat_study1,
			sessionLocale.toString());
	for (int i = 0; i < cat_study1s.size(); i++) {
		Dict catStudy1 = (Dict) cat_study1s.get(i);
		if (catStudy1.getId().toString().equals(
		request.getParameter("catvocabulary")))
			catname = catStudy1.getName();
	}
%>


<script language="javascript" type="text/javascript">
	function submitform(){
		//document.adminForm.task.value=pressbutton;
		try {
			document.adminform.onsubmit();
			}
		catch(e){}
		document.adminform.submit();
	}
		
	function submitbutton(pressbutton) {
		var form = document.adminform;
		if (pressbutton == 'cancel') {
			submitform( pressbutton );
			return;
		}
		
		if (form.targetlang.value == ""){
			alert(  "'$text.base.targetlang'$text.could_not_be_empty." );
		}		
		/*
		else  if (form.username.value.length < 6){
			alert(  "'$text.base.username'$text.length_gt_6." );
		}	
		*/
		else{
			submitform( pressbutton );
		}
	}
</script>

<table class="lessmsea" cellspacing="0" cellpadding="0">
	<tr>
		<form action="/module/study/vocabulary.do?CMD=vocabularyList" method="post" name="adminform">
		<td>
			<input type="text" name="content" size="30" />
			<mytag:select name="catvocabulary" dictName="<%=dict_cat_study1%>" />
			<mytag:national name="targetlang" dictName="<%=Constants.SYSLANGUAGE%>" />
			<input name="Submit3" type="button" value="search" onClick="javascript:submitbutton('');">
		</td>
		</form>
	</tr>
</table>
<table class="lessmsea" cellspacing="0" cellpadding="0">
	<tr>
		<td class="lessmsea01">
			| <bean:message key="study.01"/> | - |
			<%=catname%>
			|
		</td>
	</tr>
	<%
			if (Constants.KEY_REQUEST_RESULT != null) {
			DisplayPage dispage = (DisplayPage) request
			.getAttribute(Constants.KEY_REQUEST_RESULT);
			String ownUrl = "/module/study/vocabulary.do?CMD=vocabularyList";
			for (int i = 0; i < dispage.getList().size(); i++) {
				Vocabulary obj = (Vocabulary) dispage.getList().get(i);
	%>
	<tr class="lessmsea03">
		<td>
			
			<%=obj.getTranslation()%>&nbsp;（<%=obj.getContent()%>）
			<%
			if (obj.getAudio() != null && !obj.getAudio().equals("")) {
			%>
			<a
				href="/common/playMedia.jsp?fileType=<%=Constants.MEDIA_VOCABUL%>&fileUrl=<%=obj.getAudio()%>&imgpath<%=obj.getId()%>=<%=obj.getAudio()%>"
				target="_blank"><img src="/images/lessonpic01.gif" width="13"
					height="13" stype="cursor:hand" /></a>
			<%
			}
			%>
			
			
		</td>
		
		<%if(session.getAttribute(Constants.CURR_USER) != null){ %>
		<td align="right"><a href="javaScript:error(<%=obj.getCatvocabulary().getId()%>,<%=obj.getId()%>)"><img src="/images/failure.gif" ></a></td>
		<% }%>
		<%
				}
				out.print(JspHelper.getPageBar(dispage, ownUrl));
			} else {
				out.println("未找到记录");
			}
		%>
	
<script type="text/javascript">
function error(catvocabularyid,vocabularyId)
{
	window.open("/module/study/_nodeco/vocabulary.do?CMD=addError&vocabularyId="+ vocabularyId);
}
</script>